/*
 * Copyright (c) 2008, Xiong Yingfei, the University of Tokyo
 * All rights reserved.
 */
package ac.jp.u_tokyo.SyncLib.language2;

import java.util.Collection;
import java.util.LinkedList;

import ac.jp.u_tokyo.SyncLib.language.EvaluationFailedException;
import ac.jp.u_tokyo.SyncLib.language.GraphCombinatorBody;

public class VarPart extends Part{
	Var _var;
	
	public VarPart(Var var)
	{
		super();
		_var = var;
	}

	@Override
	public void addBody(GraphCombinatorBody body,
			Collection<String> genericParas, Var var)
	{
	}

	@Override
	public Var getConnectionVar(Collection<String> genericParas) throws EvaluationFailedException
	{
		_var.check(genericParas);
		return _var;
	}

	@Override
	public Collection<Var> getVarUsed(Collection<String> genericParas)
			throws EvaluationFailedException
	{
		Collection<Var> result = new LinkedList<Var>();
		result.add(_var);
		return result;
	}
}